load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "physicalplan",
    srcs = [
        "aggregator_funcs.go",
        "expression.go",
        "fake_span_resolver.go",
        "physical_plan.go",
        "span_resolver.go",
        "specs.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/physicalplan",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/kv/kvpb",
        "//pkg/roachpb",
        "//pkg/rpc",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/physicalplan/replicaoracle",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treebin",
        "//pkg/sql/types",
        "//pkg/util/hlc",
        "//pkg/util/intsets",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "physicalplan_test",
    size = "large",
    srcs = [
        "aggregator_funcs_test.go",
        "fake_span_resolver_test.go",
        "main_test.go",
        "physical_plan_test.go",
        "span_resolver_internal_test.go",
        "span_resolver_test.go",
    ],
    embed = [":physicalplan"],
    exec_properties = select({
        "//build/toolchains:is_heavy": {"test.Pool": "large"},
        "//conditions:default": {"test.Pool": "default"},
    }),
    shard_count = 16,
    deps = [
        "//pkg/base",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvclient",
        "//pkg/kv/kvclient/kvcoord",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catalogkeys",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/distsql",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfra/execagg",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/physicalplan/replicaoracle",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/testutils",
        "//pkg/testutils/distsqlutils",
        "//pkg/testutils/physicalplanutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
